package com.xtc.netty.io.bio;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.UUID;

public class BioClient {

    public static void main(String[] args) {
        try {
            Socket socket = new Socket();

            socket.connect(new InetSocketAddress("127.0.0.1", 9090));

            OutputStream outputStream = socket.getOutputStream();

            String name = UUID.randomUUID().toString();

            System.out.println("客户端发送数据：" + name);

            outputStream.write(name.getBytes());

            outputStream.close();

            socket.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
